# coding=utf-8
from PO.BasePage import Base
from PO.IndexPage import IndexPage
import time


class CityList(Base):
    """"""
    #定位器
    title_loc = ('id',"com.guokr.mentor:id/text_view_choose_city")
    closePage_loc = ('id',"com.guokr.mentor:id/image_view_close_choose_city")
    chooseCity_loc = ('xpath','//android.widget.GridView[@resource-id="com.guokr.mentor:id/gridview"]/android.widget.RelativeLayout[2]/android.widget.RelativeLayout[1]/android.widget.TextView[1]')
    #Action
    def title(self):
        """页面标题"""
        return self.find_element(self.title_loc).text

    def closePage(self):
        """关闭页面"""
        self.find_element(self.closePage_loc).click()

    def chooseCity(self):
        """选择城市"""
        self.find_element(self.chooseCity_loc).click()
